import Taro, {useDidShow} from '@tarojs/taro'
import {Button} from "@nutui/nutui-react-taro";
import {Text, View} from "@tarojs/components";
import {tabBarStore} from "@/store/tabbar-store";
import {loginApi} from "@/api/core/auth";
import {Recordable} from "@/utils";

export default function Index() {
	useDidShow(() => {
		// 页面显示时更新TabBar状态
		tabBarStore.setSelected(0)

		let params: Recordable<any> = {username: 'sss', password: 'sss'}

		loginApi(params).then(res => {
			console.log(res)
		})
	})

	const onAct = () => {
		const url = "/subPackages/pageC/user/user"
		Taro.navigateTo(({url}))
	}

	return (
		<View className='index'>
			<Text>我是首页！</Text>

			<View>
				<Button type='primary' onClick={onAct}>跳转到独立分包页</Button>
			</View>
		</View>
	)
}
